home *** CD-ROM | disk | FTP | other *** search
/ Game Cracker (Expanded Edition) / Game Cracker (Expanded Edition).iso / cracks / SV_QUAK2.ZIP / Quake II.txt < prev   
Encoding:
Text File  |  1999-05-19  |  12.2 KB  |  216 lines

  1.  
  2. Free Information Xchange presents:
  3.  
  4. Quake II v3.14 - CD crack by Static Vengeance - May 5th, 1999
  5.  
  6. REQUIREMENTS:
  7. Full game install
  8. W32Dasm & Hex editor
  9.  
  10.     Alright now, before you go and say its old... before you tell me that the latest patches eliminated
  11. the CD check anyways.  I'm writing this tut for one reason.  I'll try to show you how you can "trick" a copy
  12. protection routine into passing.  Plus, it seems most people have a copy of Quake II to work with :p
  13.     First, you'll need to know a few things about the routine.  Some things to know are:  What if any value
  14. is returned for pass or fail.  Are there any memory flag values set, like to check if the routine had actually
  15. been run or store returned or read values in memory.  Well this routine has a some of those things and I'll
  16. show you a clever way (IMHO) to bypass them all.  So let's begin with our little adventure in cracking and see
  17. where we end up:
  18.     After installing and trying to run the game you'll see a standard windows pop-up dialog box asking
  19. or telling you that you need the Quake2 CD in the CD rom drive to play.  So disassemble the quake2.exe program
  20. with W32Dasm.  Now go up to the menu bar and select refs and then select "String data references" from the drop
  21. down menu.  From the refs box, grab the slider bar and scroll down to the string "You must have the Quake2 CD
  22. in " and double click on it. This will put you here:
  23.  
  24. * Referenced by a CALL at Address:
  25. |:0042B386                                                <-- Called only once
  26. |
  27. :0042F5F0 E82BFFFFFF              call 0042F520           <-- Call the CD check routine
  28. :0042F5F5 803800                  cmp byte ptr [eax], 00  <-- Use returned value as pointer to flag
  29. :0042F5F8 750F                    jne 0042F609            <-- Must be non-zero for a passed CD check
  30.  
  31. * Possible StringData Ref from Data Obj ->"You must have the Quake2 CD in "  <-- Nasty pop-up dialog
  32.                                         ->"the drive to play."               <-- That got us here
  33.                                   |
  34. :0042F5FA 683CD24400              push 0044D23C
  35. :0042F5FF 6A00                    push 00000000
  36. :0042F601 E89A41FEFF              call 004137A0
  37. :0042F606 83C408                  add esp, 00000008
  38.  
  39. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  40. |:0042F5F8(C)
  41. |
  42. :0042F609 C3                      ret                     <-- Return to caller
  43.  
  44.     Alright, let's check out the code that checks for the CD.  A look at the code starting at
  45. 42F520 shows what's going on.  And it looks like this:
  46.  
  47. * Referenced by a CALL at Addresses:
  48. |:0042F5F0   , :0042FC81                                         <-- Called by two routines
  49. |
  50. :0042F520 A1DC224700              mov eax, dword ptr [004722DC]  <-- Did we run the CD check yet
  51. :0042F525 83EC44                  sub esp, 00000044
  52. :0042F528 85C0                    test eax, eax                  <-- Test the flag and see
  53. :0042F52A 56                      push esi
  54. :0042F52B 740A                    je 0042F537                    <-- Zero means not yet
  55. :0042F52D B8E0224700              mov eax, 004722E0              <-- Non-zero value / pointer
  56. :0042F532 5E                      pop esi
  57. :0042F533 83C444                  add esp, 00000044
  58. :0042F536 C3                      ret                            <-- Return to caller
  59.  
  60. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  61. |:0042F52B(C)
  62. |
  63. :0042F537 6A01                    push 00000001
  64.  
  65. * Reference To: KERNEL32.SetErrorMode, Ord:0213h
  66.                                   |
  67. :0042F539 FF15C4204400            Call dword ptr [004420C4]
  68.  
  69. * Reference To: KERNEL32.GetDriveTypeA, Ord:00DFh             <-- Commonly used call in CD checks
  70.                                   |
  71. :0042F53F 8B35C0204400            mov esi, dword ptr [004420C0]
  72. :0042F545 C64424053A              mov [esp+05], 3A
  73. :0042F54A C64424065C              mov [esp+06], 5C
  74. :0042F54F C644240700              mov [esp+07], 00
  75. :0042F554 C705DC22470001000000    mov dword ptr [004722DC], 00000001  <-- Was the CD check run flag
  76. :0042F55E C644240463              mov [esp+04], 63                    <-- Start with C:\ drive
  77.  
  78. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  79. |:0042F5C8(C)
  80. |
  81. :0042F563 8D442404                lea eax, dword ptr [esp+04]         <-- Current drive to check on
  82. :0042F567 50                      push eax
  83.  
  84. * Possible StringData Ref from Data Obj ->"%sinstall\data"
  85.                                   |
  86. :0042F568 682CD24400              push 0044D22C
  87. :0042F56D 68E0224700              push 004722E0
  88. :0042F572 E8692D0000              call 004322E0
  89. :0042F577 83C40C                  add esp, 0000000C
  90. :0042F57A 8D4C2404                lea ecx, dword ptr [esp+04]
  91. :0042F57E 8D542408                lea edx, dword ptr [esp+08]
  92. :0042F582 51                      push ecx
  93.  
  94. * Possible StringData Ref from Data Obj ->"%sinstall\data\quake2.exe"  <-- File to check for on the CD
  95.                                   |
  96. :0042F583 6810D24400              push 0044D210
  97. :0042F588 52                      push edx
  98. :0042F589 E8522D0000              call 004322E0
  99. :0042F58E 83C40C                  add esp, 0000000C
  100. :0042F591 8D442408                lea eax, dword ptr [esp+08]
  101.  
  102. * Possible StringData Ref from Data Obj ->"r"                  <-- Read the file
  103.                                   |
  104. :0042F595 680CD24400              push 0044D20C
  105. :0042F59A 50                      push eax
  106. :0042F59B E8002A0000              call 00431FA0
  107. :0042F5A0 83C408                  add esp, 00000008
  108. :0042F5A3 85C0                    test eax, eax
  109. :0042F5A5 7415                    je 0042F5BC
  110. :0042F5A7 50                      push eax
  111. :0042F5A8 E813240000              call 004319C0
  112. :0042F5AD 83C404                  add esp, 00000004
  113. :0042F5B0 8D4C2404                lea ecx, dword ptr [esp+04]
  114. :0042F5B4 51                      push ecx
  115. :0042F5B5 FFD6                    call esi                      <-- Make the getdrivetypea call
  116. :0042F5B7 83F805                  cmp eax, 00000005             <-- 05 is code for CD Rom drive
  117. :0042F5BA 741C                    je 0042F5D8                   <-- Exit to "good" check section of code
  118.  
  119. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  120. |:0042F5A5(C)
  121. |
  122. :0042F5BC 8A442404                mov al, byte ptr [esp+04]    <-- Current drive to check on
  123. :0042F5C0 FEC0                    inc al                       <-- Let's try the next one
  124. :0042F5C2 3C7A                    cmp al, 7A                   <-- Stop after drive Z:\
  125. :0042F5C4 88442404                mov byte ptr [esp+04], al    <-- Store it back
  126. :0042F5C8 7E99                    jle 0042F563                 <-- Less then Z go back up and try again
  127. :0042F5CA C605E022470000          mov byte ptr [004722E0], 00  <-- Set up for failed CD read
  128. :0042F5D1 33C0                    xor eax, eax                 <-- return failed read value in eax
  129. :0042F5D3 5E                      pop esi
  130. :0042F5D4 83C444                  add esp, 00000044
  131. :0042F5D7 C3                      ret                          <-- Return to caller
  132.  
  133. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  134. |:0042F5BA(C)
  135. |
  136. :0042F5D8 B8E0224700              mov eax, 004722E0   <-- Used as pointer to pass/fail flag
  137. :0042F5DD 5E                      pop esi
  138. :0042F5DE 83C444                  add esp, 00000044
  139. :0042F5E1 C3                      ret                 <-- Return to caller
  140.  
  141.     A quick description of what's going on with the above.  First the CD check routine will check
  142. if the code that checks for the CD has been run.  A non-zero value stored at 4722DC means the CD
  143. check has been run.  If it hasn't been run, the code branches down to the routine that actualy checks
  144. for the quake2.exe file on the CD.  The first thing that routine does is set up variables and stores
  145. a 01 in the CD check was run flag.  This way the CD check will only be run one time through.  Then
  146. the code will start with drive C:\ and check for quake2.exe in the directory install\data\.  Once found
  147. it checks the drive it found the file on to see if it's a CD Rom drive.  If it is, then the code jumps
  148. down to the pass section of the routine.  If not, it'll increment the drive letter and jump back up to
  149. start checking for the quake2.exe all over.  Finally, if all possible drives have been checked and
  150. the CD has not been found a zero 4722E0 for a failed CD check.  However, if all things went well (in
  151. the eyes of copy protection) eax is loaded with 004722E0, which is the memory location of the CD check
  152. pass/fail flag.  Then the code that called the CD check will use this value as a pointer and check the
  153. value stored there.  If 4722E0 holds a zero then up pops a standard windows dialog box telling you, you
  154. will need the Quake 2 CD in the drive to play the game.
  155.     After looking at this code, I decided I would reroute the code and force it into setting up
  156. the proper flags then jump to the "passed CD check" section.  To do that we need to run the code up
  157. through 42F55E, then get down to 42F5CA.  Once there, change the code to store a 01 instead of the 00
  158. it does now.  Now take the xor eax, eax and change that to a jmp 42F5D8.  Now all conditions are met,
  159. the flag for "did the CD check run?" is set then the code stores a non-zero value in the actual CD
  160. check pass/fail at 4722E0.  And finally the CD check exits through "passed CD check" portion of the
  161. code.  This will all work by making "two" changes to code.  At 42F563, change the lea eax, dword ptr
  162. [esp+04] and the push eax to jmp 42F5CA by changing the hex from 8D 44 24 04 50 to E9 62 00 00 00.
  163. Then for the second edit, for forcing a non-zero value in the CD checking flag and the code redirect
  164. to the pass section, change the hex bytes 00 33 C0 to 01 EB 05 at 42F5D0.  To let you see what the
  165. computer would run, it would look something like this (in process):
  166.  
  167. :0042F537 6A01                    push 00000001
  168.  
  169. * Reference To: KERNEL32.SetErrorMode, Ord:0213h
  170.                                   |
  171. :0042F539 FF15C4204400            Call dword ptr [004420C4]
  172.  
  173. * Reference To: KERNEL32.GetDriveTypeA, Ord:00DFh             <-- Commonly used call in CD checks
  174.                                   |
  175. :0042F53F 8B35C0204400            mov esi, dword ptr [004420C0]
  176. :0042F545 C64424053A              mov [esp+05], 3A
  177. :0042F54A C64424065C              mov [esp+06], 5C
  178. :0042F54F C644240700              mov [esp+07], 00
  179. :0042F554 C705DC22470001000000    mov dword ptr [004722DC], 00000001  <-- Was the CD check run flag
  180. :0042F55E C644240463              mov [esp+04], 63                    <-- Start with C:\ drive
  181. :0042F563 E962000000              jmp 0047F5CA                        <-- Jump down to force it code
  182.  
  183. :0042F5CA C605E022470001          mov byte ptr [004722E0], 01  <-- Force value for a passed CD read
  184. :0042F5D1 EB05                    jmp 0042F5D8                 <-- Jump to passed CD check & exit code
  185.  
  186. :0042F5D8 B8E0224700              mov eax, 004722E0   <-- Used as pointer to pass/fail flag
  187. :0042F5DD 5E                      pop esi
  188. :0042F5DE 83C444                  add esp, 00000044
  189. :0042F5E1 C3                      ret                 <-- Return to caller
  190.  
  191.     These modifications will force all conditions of the CD check to pass reguardless of who calls
  192. the check or how many times it's called even when no CD is present.  Like I said the latest versions of
  193. Quake II patches eliminate the CD check routines - hhmmmm, wonder why that is?  Still there is/was a need
  194. to show a tutorial on how it can be cracked.  This tutorial showed you how you can alter CD checks into
  195. setting the correct flags and returning the correct values.  Other tutorials I have done on rerouting code
  196. and or forcing the flags would be VR Powerboat Racing and Hardcore 4x4 Racing.  Read 'em if you need 'em.
  197. Until the next tutorial, good luck in your cracking efforts!
  198.  
  199. 1.  Do a full install of the game
  200. 2.  Make the following edits:
  201.  
  202. Edit quake2.exe
  203. ==============================
  204. Search for: 8D 44 24 04 50  at
  205. Change to : E9 62 00 00 00
  206.  
  207. Search for: 00 33 C0
  208. Change to : 01 EB 05
  209.  
  210. 3.  Enjoy the game! -- and frag somebodys ass!
  211. 4.  Download and install the latest v3.20 patches
  212. 5.  If you have a CPU with the 3DNow! instruction set, get the 3DNow! accelerated patch
  213.  
  214. Static Vengeance - FiX
  215.  
  216.